From cb4d3d85cd4b683d4675fe209e21e41fbf42e853 Mon Sep 17 00:00:00 2001 From: gentoo90 Date: Sun, 26 Jul 2015 13:59:57 +0300 Subject: [PATCH] Bashcomp: add missing options, add --vcs completion --- src/etc/cargo.bashcomp.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/etc/cargo.bashcomp.sh b/src/etc/cargo.bashcomp.sh index 1b036e5ae..d3a1649a8 100644 --- a/src/etc/cargo.bashcomp.sh +++ b/src/etc/cargo.bashcomp.sh @@ -9,8 +9,12 @@ _cargo() cmd=${words[1]} local commands=$(cargo --list | tail -n +2) + local vcs='git hg none' - local opt_common='-h --help -v --verbose' + local opt_help='-h --help' + local opt_verbose='-v --verbose' + local opt_quiet='-q --quiet' + local opt_common="$opt_help $opt_verbose $opt_quiet" local opt_pkg='-p --package' local opt_feat='--features --no-default-features' local opt_mani='--manifest-path' @@ -30,7 +34,7 @@ _cargo() local opt__owner="$opt_common -a --add -r --remove -l --list --index --token" local opt__pkgid="${opt__fetch}" local opt__publish="$opt_common $opt_mani --host --token --no-verify" - local opt__read_manifest="${opt__fetch}" + local opt__read_manifest="$opt_help $opt_verbose $opt_mani" local opt__run="$opt_common $opt_feat $opt_mani $opt_jobs --target --bin --example --release" local opt__rustc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --release" local opt__search="$opt_common --host" @@ -38,7 +42,7 @@ _cargo() local opt__update="$opt_common $opt_pkg $opt_mani --aggressive --precise" local opt__package="$opt_common $opt_mani -l --list --no-verify --no-metadata" local opt__verify_project="${opt__fetch}" - local opt__version="$opt_common" + local opt__version="$opt_help $opt_verbose" local opt__yank="$opt_common --vers --undo --index --token" if [[ $cword -eq 1 ]]; then @@ -49,6 +53,9 @@ _cargo() fi elif [[ $cword -ge 2 ]]; then case "${prev}" in + --vcs) + COMPREPLY=( $( compgen -W "$vcs" -- "$cur" ) ) + ;; --manifest-path) _filedir toml ;; -- 2.30.2